display: Avoid unsetting the DESKTOP_STARTUP_ID variable too late
authorMario Sanchez Prada <msanchez@gnome.org>
Mon, 11 Jun 2018 15:09:06 +0000 (16:09 +0100)
committerMario Sanchez Prada <msanchez@gnome.org>
Mon, 11 Jun 2018 15:28:24 +0000 (16:28 +0100)
commitef3427575fe49c19f35defd292d647c0792e2fc4
tree55c39b956650d7a51eb6853e4193fc04c9c6225a
parent33b8f087a3b32b9e40fce3b4efc413f4c0e066c8
display: Avoid unsetting the DESKTOP_STARTUP_ID variable too late

Similar to what has been done recently for DESKTOP_AUTOSTART_ID [1],
we need to get rid of this call to g_unsetenv() in the displays'
backends for X11 and Wayland, so that it's guarantee to happen any
thread is created, while still being accessible when needed.

Let's stash the value of this environment variable when loading the
GDK library, and provide a private method so that it can be retrieved
from the displays' backend when implementing gdk_display_make_default().

[1] https://gitlab.gnome.org/GNOME/gtk/commit/22269902

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/979
gdk/gdk-private.h
gdk/gdk.c
gdk/wayland/gdkdisplay-wayland.c
gdk/x11/gdkdisplay-x11.c